/***************************************************************************
* COPYRIGHT NOTICE
* Copyright 2019 Horizon Robotics, Inc.
* All rights reserved.
***************************************************************************/
#ifndef UTILITY_SENSOR_INC_IMX586_SETTING_H_
#define UTILITY_SENSOR_INC_IMX586_SETTING_H_

#define IMX586_PARAM_HOLD  	(0x0104)
#define IMX586_LINE      	(0x0202)
#define IMX586_GAIN         (0x0204)
#define IMX586_DGAIN		(0x020e)
#define IMX586_VTS	       	(0x0340)
#define IMX586_HTS	        (0x0342)
#define IMX586_X_SIZE   	(0x034C)
#define IMX586_Y_SIZE  		(0x034E)
#define DEFAULT_FPS_REGVALUE	(3064)
#define DEFAULT_FPS				(30)

/* MIPI limited mipiclk 8784MHZ, so each lane max 2196MHZ */
#define EN_EXP_HDR_30FPS	0 /* 2084MHZ/lane */
#define EN_QHDR_30FPS_0	0 /* 2496MHZ/lane */
#define EN_QHDR_30FPS_1	1 /* 2376MHZ/lane */

uint32_t imx586_again_lut[] = {
    0x0,
    0x15,
    0x2b,
    0x40,
    0x54,
    0x69,
    0x7c,
    0x90,
    0xa2,
    0xb5,
    0xc7,
    0xd9,
    0xea,
    0xfb,
    0x10b,
    0x11c,
    0x12b,
    0x13b,
    0x14a,
    0x159,
    0x168,
    0x176,
    0x184,
    0x191,
    0x19f,
    0x1ac,
    0x1b8,
    0x1c5,
    0x1d1,
    0x1dd,
    0x1e9,
    0x1f4,
    0x200,
    0x20a,
    0x215,
    0x220,
    0x22a,
    0x234,
    0x23e,
    0x248,
    0x251,
    0x25a,
    0x263,
    0x26c,
    0x275,
    0x27d,
    0x285,
    0x28e,
    0x295,
    0x29d,
    0x2a5,
    0x2ac,
    0x2b4,
    0x2bb,
    0x2c2,
    0x2c8,
    0x2cf,
    0x2d6,
    0x2dc,
    0x2e2,
    0x2e8,
    0x2ee,
    0x2f4,
    0x2fa,
    0x300,
    0x305,
    0x30a,
    0x310,
    0x315,
    0x31a,
    0x31f,
    0x324,
    0x328,
    0x32d,
    0x331,
    0x336,
    0x33a,
    0x33e,
    0x342,
    0x347,
    0x34a,
    0x34e,
    0x352,
    0x356,
    0x35a,
    0x35d,
    0x361,
    0x364,
    0x367,
    0x36b,
    0x36e,
    0x371,
    0x374,
    0x377,
    0x37a,
    0x37d,
    0x380,
    0x382,
    0x385,
    0x388,
    0x38a,
    0x38d,
    0x38f,
    0x392,
    0x394,
    0x396,
    0x398,
    0x39b,
    0x39d,
    0x39f,
    0x3a1,
    0x3a3,
    0x3a5,
    0x3a7,
    0x3a9,
    0x3ab,
    0x3ad,
    0x3ae,
    0x3b0,
    0x3b2,
    0x3b3,
    0x3b5,
    0x3b7,
    0x3b8,
    0x3ba,
    0x3bb,
    0x3bd,
    0x3be,
    0x3c0,
    0x3c1,
    0x3c2,
    0x3c4,
    0x3c5,
    0x3c6,
    0x3c7,
    0x3c9,
    0x3ca,
    0x3cb,
    0x3cc,
    0x3cd,
    0x3ce,
    0x3cf,
    0x3d0,
    0x3d1,
    0x3d2,
    0x3d3,
    0x3d4,
    0x3d5,
    0x3d6,
    0x3d7,
    0x3d8,
    0x3d9,
    0x3d9,
    0x3da,
    0x3db,
    0x3dc,
    0x3dd,
    0x3dd,
    0x3de,
    0x3df,
    0x3e0,
};

uint32_t imx586_dgain_lut[] = {
    0x100,
    0x105,
    0x10b,
    0x111,
    0x117,
    0x11d,
    0x123,
    0x129,
    0x130,
    0x137,
    0x13d,
    0x144,
    0x14b,
    0x153,
    0x15a,
    0x162,
    0x16a,
    0x171,
    0x17a,
    0x182,
    0x18a,
    0x193,
    0x19c,
    0x1a5,
    0x1ae,
    0x1b7,
    0x1c1,
    0x1cb,
    0x1d5,
    0x1df,
    0x1ea,
    0x1f5,
    0x200,
    0x20b,
    0x216,
    0x222,
    0x22e,
    0x23a,
    0x247,
    0x253,
    0x260,
    0x26e,
    0x27b,
    0x289,
    0x297,
    0x2a6,
    0x2b5,
    0x2c4,
    0x2d4,
    0x2e3,
    0x2f4,
    0x304,
    0x315,
    0x326,
    0x338,
    0x34a,
    0x35d,
    0x36f,
    0x383,
    0x396,
    0x3ab,
    0x3bf,
    0x3d4,
    0x3ea,
    0x400,
    0x416,
    0x42d,
    0x444,
    0x45c,
    0x475,
    0x48e,
    0x4a7,
    0x4c1,
    0x4dc,
    0x4f7,
    0x513,
    0x52f,
    0x54d,
    0x56a,
    0x589,
    0x5a8,
    0x5c7,
    0x5e8,
    0x609,
    0x62b,
    0x64d,
    0x671,
    0x695,
    0x6ba,
    0x6df,
    0x706,
    0x72d,
    0x756,
    0x77f,
    0x7a9,
    0x7d4,
    0x800,
    0x82c,
    0x85a,
    0x889,
    0x8b9,
    0x8ea,
    0x91c,
    0x94f,
    0x983,
    0x9b8,
    0x9ef,
    0xa27,
    0xa5f,
    0xa9a,
    0xad5,
    0xb12,
    0xb50,
    0xb8f,
    0xbd0,
    0xc12,
    0xc56,
    0xc9b,
    0xce2,
    0xd2a,
    0xd74,
    0xdbf,
    0xe0c,
    0xe5b,
    0xeac,
    0xefe,
    0xf52,
    0xfa8,
    0xfff,
};

uint16_t imx586_init_3840x2160_setting[] = {
    0x0136, 0x18,
    0x0137, 0x00,
    0x3C7E, 0x02,
    0x3C7F, 0x0A,
    0x0111, 0x02,
    0x380C, 0x00,
    0x3C00, 0x10,
    0x3C01, 0x10,
    0x3C02, 0x10,
    0x3C03, 0x10,
    0x3C04, 0x10,
    0x3C05, 0x01,
    0x3C06, 0x00,
    0x3C07, 0x00,
    0x3C08, 0x03,
    0x3C09, 0xFF,
    0x3C0A, 0x01,
    0x3C0B, 0x00,
    0x3C0C, 0x00,
    0x3C0D, 0x03,
    0x3C0E, 0xFF,
    0x3C0F, 0x20,
    0x3F88, 0x00,
    0x3F8E, 0x00,
    0x5282, 0x01,
    0x9004, 0x14,
    0x9200, 0xF4,
    0x9201, 0xA7,
    0x9202, 0xF4,
    0x9203, 0xAA,
    0x9204, 0xF4,
    0x9205, 0xAD,
    0x9206, 0xF4,
    0x9207, 0xB0,
    0x9208, 0xF4,
    0x9209, 0xB3,
    0x920A, 0xB7,
    0x920B, 0x34,
    0x920C, 0xB7,
    0x920D, 0x36,
    0x920E, 0xB7,
    0x920F, 0x37,
    0x9210, 0xB7,
    0x9211, 0x38,
    0x9212, 0xB7,
    0x9213, 0x39,
    0x9214, 0xB7,
    0x9215, 0x3A,
    0x9216, 0xB7,
    0x9217, 0x3C,
    0x9218, 0xB7,
    0x9219, 0x3D,
    0x921A, 0xB7,
    0x921B, 0x3E,
    0x921C, 0xB7,
    0x921D, 0x3F,
    0x921E, 0x77,
    0x921F, 0x77,
    0x9222, 0xC4,
    0x9223, 0x4B,
    0x9224, 0xC4,
    0x9225, 0x4C,
    0x9226, 0xC4,
    0x9227, 0x4D,
    0x9810, 0x14,
    0x9814, 0x14,
    0x99B2, 0x20,
    0x99B3, 0x0F,
    0x99B4, 0x0F,
    0x99B5, 0x0F,
    0x99B6, 0x0F,
    0x99E4, 0x0F,
    0x99E5, 0x0F,
    0x99E6, 0x0F,
    0x99E7, 0x0F,
    0x99E8, 0x0F,
    0x99E9, 0x0F,
    0x99EA, 0x0F,
    0x99EB, 0x0F,
    0x99EC, 0x0F,
    0x99ED, 0x0F,
    0xA569, 0x06,
    0xA56A, 0x13,
    0xA56B, 0x13,
    0xA679, 0x20,
    0xA830, 0x68,
    0xA831, 0x56,
    0xA832, 0x2B,
    0xA833, 0x55,
    0xA834, 0x55,
    0xA835, 0x16,
    0xA837, 0x51,
    0xA838, 0x34,
    0xA854, 0x4F,
    0xA855, 0x48,
    0xA856, 0x45,
    0xA857, 0x02,
    0xA85A, 0x23,
    0xA85B, 0x16,
    0xA85C, 0x12,
    0xA85D, 0x02,
    0xAC72, 0x01,
    0xAC73, 0x26,
    0xAC74, 0x01,
    0xAC75, 0x26,
    0xAC76, 0x00,
    0xAC77, 0xC4,
    0xB051, 0x02,
    0xC020, 0x01,
    0xC61D, 0x00,
    0xC625, 0x00,
    0xC638, 0x03,
    0xC63B, 0x01,
    0xE286, 0x31,
    0xE2A6, 0x32,
    0xE2C6, 0x33,
    0xEA4B, 0x00,
    0xEA4C, 0x00,
    0xEA4D, 0x00,
    0xEA4E, 0x00,
    0xF000, 0x00,
    0xF001, 0x10,
    0xF00C, 0x00,
    0xF00D, 0x40,
    0xF030, 0x00,
    0xF031, 0x10,
    0xF03C, 0x00,
    0xF03D, 0x40,
    0xF44B, 0x80,
    0xF44C, 0x10,
    0xF44D, 0x06,
    0xF44E, 0x80,
    0xF44F, 0x10,
    0xF450, 0x06,
    0xF451, 0x80,
    0xF452, 0x10,
    0xF453, 0x06,
    0xF454, 0x80,
    0xF455, 0x10,
    0xF456, 0x06,
    0xF457, 0x80,
    0xF458, 0x10,
    0xF459, 0x06,
    0xF478, 0x20,
    0xF479, 0x80,
    0xF47A, 0x80,
    0xF47B, 0x20,
    0xF47C, 0x80,
    0xF47D, 0x80,
    0xF47E, 0x20,
    0xF47F, 0x80,
    0xF480, 0x80,
    0xF481, 0x20,
    0xF482, 0x60,
    0xF483, 0x80,
    0xF484, 0x20,
    0xF485, 0x60,
    0xF486, 0x80,
    0x9852, 0x00,
    0x9954, 0x0F,
    0xA7AD, 0x01,
    0xA7CB, 0x01,
    0xAE09, 0xFF,
    0xAE0A, 0xFF,
    0xAE12, 0x58,
    0xAE13, 0x58,
    0xAE15, 0x10,
    0xAE16, 0x10,
    0xAF05, 0x48,
    0xB07C, 0x02,

    0x0112, 0x0A,
    0x0113, 0x0A,
    0x0114, 0x03,
    0x0342, 0x23,    // 8976
    0x0343, 0x10,
    0x0340, 0x0B,    // 3064
    0x0341, 0xF8,


    0x0344, 0x00,
    0x0345, 0x00,
    0x0346, 0x02,
    0x0347, 0xE8,
    0x0348, 0x1F,
    0x0349, 0x3F,
    0x034A, 0x14,
    0x034B, 0x87,

    //  mode
    0x0220, 0x62,   // binning
    0x0222, 0x01,
    0x0900, 0x01,
    0x0901, 0x22,
    0x0902, 0x08,
    0x3140, 0x00,
    0x3246, 0x81,
    0x3247, 0x81,
    0x3F15, 0x00,
    0x0401, 0x00,
    0x0404, 0x00,
    0x0405, 0x10,
    0x0408, 0x00,
    0x0409, 0x50,
    0x040A, 0x00,
    0x040B, 0x30,
    0x040C, 0x0F,
    0x040D, 0x00,
    0x040E, 0x08,
    0x040F, 0x70,
    0x034C, 0x0F,    // 3840
    0x034D, 0x00,
    0x034E, 0x08,    // 2160
    0x034F, 0x70,
    // clk
    0x0301, 0x05,
    0x0303, 0x04,
    0x0305, 0x04,
    0x0306, 0x01,
    0x0307, 0x58,
    0x030B, 0x02,
    0x030D, 0x03,
    0x030E, 0x01,
    0x030F, 0x1F,
    0x0310, 0x01,

    0x3620, 0x00,
    0x3621, 0x00,
    0x3C11, 0x04,
    0x3C12, 0x03,
    0x3C13, 0x2D,
    0x3F0C, 0x01,
    0x3F14, 0x00,
    0x3F80, 0x01,
    0x3F81, 0x90,
    0x3F8C, 0x00,
    0x3F8D, 0x14,
    0x3FF8, 0x01,
    0x3FF9, 0x2A,
    0x3FFE, 0x00,
    0x3FFF, 0x6C,
    0x0202, 0x0F,    // coase line
    0x0203, 0x78,
    0x0224, 0x01,    // fine line
    0x0225, 0xF4,
    0x3FE0, 0x01,
    0x3FE1, 0xF4,
    0x0204, 0x00,
    0x0205, 0x70,
    0x0216, 0x00,
    0x0217, 0x70,
    0x0218, 0x01,
    0x0219, 0x00,
    0x020E, 0x01,
    0x020F, 0x00,
    0x0210, 0x01,
    0x0211, 0x00,
    0x0212, 0x01,
    0x0213, 0x00,
    0x0214, 0x01,
    0x0215, 0x00,
    0x3FE2, 0x00,
    0x3FE3, 0x70,
    0x3FE4, 0x01,
    0x3FE5, 0x00,
    0x323B, 0x00,
    0x323C, 0x00,
    0x3E20, 0x01,
    0x3E37, 0x01,
};

uint16_t imx586_init_4000x3000_setting[] = {
    0x0136, 0x18,
    0x0137, 0x00,
    0x3C7E, 0x0A,
    0x3C7F, 0x0A,
    0x0111, 0x02,
    0x380C, 0x00,
    0x3C00, 0x10,
    0x3C01, 0x10,
    0x3C02, 0x10,
    0x3C03, 0x10,
    0x3C04, 0x10,
    0x3C05, 0x01,
    0x3C06, 0x00,
    0x3C07, 0x00,
    0x3C08, 0x03,
    0x3C09, 0xFF,
    0x3C0A, 0x01,
    0x3C0B, 0x00,
    0x3C0C, 0x00,
    0x3C0D, 0x03,
    0x3C0E, 0xFF,
    0x3C0F, 0x20,
    0x3F88, 0x00,
    0x3F8E, 0x00,
    0x5282, 0x01,
    0x9004, 0x14,
    0x9200, 0xF4,
    0x9201, 0xA7,
    0x9202, 0xF4,
    0x9203, 0xAA,
    0x9204, 0xF4,
    0x9205, 0xAD,
    0x9206, 0xF4,
    0x9207, 0xB0,
    0x9208, 0xF4,
    0x9209, 0xB3,
    0x920A, 0xB7,
    0x920B, 0x34,
    0x920C, 0xB7,
    0x920D, 0x36,
    0x920E, 0xB7,
    0x920F, 0x37,
    0x9210, 0xB7,
    0x9211, 0x38,
    0x9212, 0xB7,
    0x9213, 0x39,
    0x9214, 0xB7,
    0x9215, 0x3A,
    0x9216, 0xB7,
    0x9217, 0x3C,
    0x9218, 0xB7,
    0x9219, 0x3D,
    0x921A, 0xB7,
    0x921B, 0x3E,
    0x921C, 0xB7,
    0x921D, 0x3F,
    0x921E, 0x77,
    0x921F, 0x77,
    0x9222, 0xC4,
    0x9223, 0x4B,
    0x9224, 0xC4,
    0x9225, 0x4C,
    0x9226, 0xC4,
    0x9227, 0x4D,
    0x9810, 0x14,
    0x9814, 0x14,
    0x99B2, 0x20,
    0x99B3, 0x0F,
    0x99B4, 0x0F,
    0x99B5, 0x0F,
    0x99B6, 0x0F,
    0x99E4, 0x0F,
    0x99E5, 0x0F,
    0x99E6, 0x0F,
    0x99E7, 0x0F,
    0x99E8, 0x0F,
    0x99E9, 0x0F,
    0x99EA, 0x0F,
    0x99EB, 0x0F,
    0x99EC, 0x0F,
    0x99ED, 0x0F,
    0xA569, 0x06,
    0xA56A, 0x13,
    0xA56B, 0x13,
    0xA679, 0x20,
    0xA830, 0x68,
    0xA831, 0x56,
    0xA832, 0x2B,
    0xA833, 0x55,
    0xA834, 0x55,
    0xA835, 0x16,
    0xA837, 0x51,
    0xA838, 0x34,
    0xA854, 0x4F,
    0xA855, 0x48,
    0xA856, 0x45,
    0xA857, 0x02,
    0xA85A, 0x23,
    0xA85B, 0x16,
    0xA85C, 0x12,
    0xA85D, 0x02,
    0xAC72, 0x01,
    0xAC73, 0x26,
    0xAC74, 0x01,
    0xAC75, 0x26,
    0xAC76, 0x00,
    0xAC77, 0xC4,
    0xB051, 0x02,
    0xC020, 0x01,
    0xC61D, 0x00,
    0xC625, 0x00,
    0xC638, 0x03,
    0xC63B, 0x01,
    0xE286, 0x31,
    0xE2A6, 0x32,
    0xE2C6, 0x33,
    0xEA4B, 0x00,
    0xEA4C, 0x00,
    0xEA4D, 0x00,
    0xEA4E, 0x00,
    0xF000, 0x00,
    0xF001, 0x10,
    0xF00C, 0x00,
    0xF00D, 0x40,
    0xF030, 0x00,
    0xF031, 0x10,
    0xF03C, 0x00,
    0xF03D, 0x40,
    0xF44B, 0x80,
    0xF44C, 0x10,
    0xF44D, 0x06,
    0xF44E, 0x80,
    0xF44F, 0x10,
    0xF450, 0x06,
    0xF451, 0x80,
    0xF452, 0x10,
    0xF453, 0x06,
    0xF454, 0x80,
    0xF455, 0x10,
    0xF456, 0x06,
    0xF457, 0x80,
    0xF458, 0x10,
    0xF459, 0x06,
    0xF478, 0x20,
    0xF479, 0x80,
    0xF47A, 0x80,
    0xF47B, 0x20,
    0xF47C, 0x80,
    0xF47D, 0x80,
    0xF47E, 0x20,
    0xF47F, 0x80,
    0xF480, 0x80,
    0xF481, 0x20,
    0xF482, 0x60,
    0xF483, 0x80,
    0xF484, 0x20,
    0xF485, 0x60,
    0xF486, 0x80,

    0x9852, 0x00,
    0x9954, 0x0F,
    0xA7AD, 0x01,
    0xA7CB, 0x01,
    0xAE09, 0xFF,
    0xAE0A, 0xFF,
    0xAE12, 0x58,
    0xAE13, 0x58,
    0xAE15, 0x10,
    0xAE16, 0x10,
    0xAF05, 0x48,
    0xB07C, 0x02,

    0x0112, 0x0A,
    0x0113, 0x0A,
    0x0114, 0x03,
    0x0342, 0x23,  // 8976
    0x0343, 0x10,
    0x0340, 0x0B,  // 3064
    0x0341, 0xF8,

    0x0344, 0x00,
    0x0345, 0x00,
    0x0346, 0x00,
    0x0347, 0x00,
    0x0348, 0x1F,
    0x0349, 0x3F,
    0x034A, 0x17,
    0x034B, 0x6F,

    0x0220, 0x62,
    0x0222, 0x01,
    0x0900, 0x01,
    0x0901, 0x22,
    0x0902, 0x08,
    0x3140, 0x00,
    0x3246, 0x81,
    0x3247, 0x81,
    0x3F15, 0x00,
    0x0401, 0x00,
    0x0404, 0x00,
    0x0405, 0x10,
    0x0408, 0x00,
    0x0409, 0x00,
    0x040A, 0x00,
    0x040B, 0x00,
    0x040C, 0x0F,
    0x040D, 0xA0,
    0x040E, 0x0B,
    0x040F, 0xB8,
    0x034C, 0x0F,	//4000
    0x034D, 0xA0,
    0x034E, 0x0B,	//3000
    0x034F, 0xB8,
    0x0301, 0x05,
    0x0303, 0x04,
    0x0305, 0x04,
    0x0306, 0x01,
    0x0307, 0x58,
    0x030B, 0x02,
    0x030D, 0x03,
    0x030E, 0x01,
    0x030F, 0x1F,
    0x0310, 0x01,
    0x3620, 0x00,
    0x3621, 0x00,
    0x3C11, 0x04,
    0x3C12, 0x03,
    0x3C13, 0x2D,
    0x3F0C, 0x01,
    0x3F14, 0x00,
    0x3F80, 0x00,
    0x3F81, 0x14,
    0x3F8C, 0x00,
    0x3F8D, 0x14,
    0x3FF8, 0x00,
    0x3FF9, 0x3C,
    0x3FFE, 0x01,
    0x3FFF, 0x8C,
    0x0202, 0x0B,
    0x0203, 0xC8,
    0x0224, 0x01,
    0x0225, 0xF4,
    0x3FE0, 0x01,
    0x3FE1, 0xF4,
    0x0204, 0x00,
    0x0205, 0x70,
    0x0216, 0x00,
    0x0217, 0x70,
    0x0218, 0x01,
    0x0219, 0x00,
    0x020E, 0x01,
    0x020F, 0x00,
    0x0210, 0x01,
    0x0211, 0x00,
    0x0212, 0x01,
    0x0213, 0x00,
    0x0214, 0x01,
    0x0215, 0x00,
    0x3FE2, 0x00,
    0x3FE3, 0x70,
    0x3FE4, 0x01,
    0x3FE5, 0x00,
    0x323B, 0x00,
    0x323C, 0x00,
    0x3E20, 0x02,
    0x3E3B, 0x01,
    0x4434, 0x01,
    0x4435, 0xF0,
};

uint16_t imx586_init_4000x2250_setting[] = {
    0x0136, 0x18,
    0x0137, 0x00,
    0x3C7E, 0x0A,
    0x3C7F, 0x0A,
    0x0111, 0x02,
    0x380C, 0x00,
    0x3C00, 0x10,
    0x3C01, 0x10,
    0x3C02, 0x10,
    0x3C03, 0x10,
    0x3C04, 0x10,
    0x3C05, 0x01,
    0x3C06, 0x00,
    0x3C07, 0x00,
    0x3C08, 0x03,
    0x3C09, 0xFF,
    0x3C0A, 0x01,
    0x3C0B, 0x00,
    0x3C0C, 0x00,
    0x3C0D, 0x03,
    0x3C0E, 0xFF,
    0x3C0F, 0x20,
    0x3F88, 0x00,
    0x3F8E, 0x00,
    0x5282, 0x01,
    0x9004, 0x14,
    0x9200, 0xF4,
    0x9201, 0xA7,
    0x9202, 0xF4,
    0x9203, 0xAA,
    0x9204, 0xF4,
    0x9205, 0xAD,
    0x9206, 0xF4,
    0x9207, 0xB0,
    0x9208, 0xF4,
    0x9209, 0xB3,
    0x920A, 0xB7,
    0x920B, 0x34,
    0x920C, 0xB7,
    0x920D, 0x36,
    0x920E, 0xB7,
    0x920F, 0x37,
    0x9210, 0xB7,
    0x9211, 0x38,
    0x9212, 0xB7,
    0x9213, 0x39,
    0x9214, 0xB7,
    0x9215, 0x3A,
    0x9216, 0xB7,
    0x9217, 0x3C,
    0x9218, 0xB7,
    0x9219, 0x3D,
    0x921A, 0xB7,
    0x921B, 0x3E,
    0x921C, 0xB7,
    0x921D, 0x3F,
    0x921E, 0x77,
    0x921F, 0x77,
    0x9222, 0xC4,
    0x9223, 0x4B,
    0x9224, 0xC4,
    0x9225, 0x4C,
    0x9226, 0xC4,
    0x9227, 0x4D,
    0x9810, 0x14,
    0x9814, 0x14,
    0x99B2, 0x20,
    0x99B3, 0x0F,
    0x99B4, 0x0F,
    0x99B5, 0x0F,
    0x99B6, 0x0F,
    0x99E4, 0x0F,
    0x99E5, 0x0F,
    0x99E6, 0x0F,
    0x99E7, 0x0F,
    0x99E8, 0x0F,
    0x99E9, 0x0F,
    0x99EA, 0x0F,
    0x99EB, 0x0F,
    0x99EC, 0x0F,
    0x99ED, 0x0F,
    0xA569, 0x06,
    0xA56A, 0x13,
    0xA56B, 0x13,
    0xA679, 0x20,
    0xA830, 0x68,
    0xA831, 0x56,
    0xA832, 0x2B,
    0xA833, 0x55,
    0xA834, 0x55,
    0xA835, 0x16,
    0xA837, 0x51,
    0xA838, 0x34,
    0xA854, 0x4F,
    0xA855, 0x48,
    0xA856, 0x45,
    0xA857, 0x02,
    0xA85A, 0x23,
    0xA85B, 0x16,
    0xA85C, 0x12,
    0xA85D, 0x02,
    0xAC72, 0x01,
    0xAC73, 0x26,
    0xAC74, 0x01,
    0xAC75, 0x26,
    0xAC76, 0x00,
    0xAC77, 0xC4,
    0xB051, 0x02,
    0xC020, 0x01,
    0xC61D, 0x00,
    0xC625, 0x00,
    0xC638, 0x03,
    0xC63B, 0x01,
    0xE286, 0x31,
    0xE2A6, 0x32,
    0xE2C6, 0x33,
    0xEA4B, 0x00,
    0xEA4C, 0x00,
    0xEA4D, 0x00,
    0xEA4E, 0x00,
    0xF000, 0x00,
    0xF001, 0x10,
    0xF00C, 0x00,
    0xF00D, 0x40,
    0xF030, 0x00,
    0xF031, 0x10,
    0xF03C, 0x00,
    0xF03D, 0x40,
    0xF44B, 0x80,
    0xF44C, 0x10,
    0xF44D, 0x06,
    0xF44E, 0x80,
    0xF44F, 0x10,
    0xF450, 0x06,
    0xF451, 0x80,
    0xF452, 0x10,
    0xF453, 0x06,
    0xF454, 0x80,
    0xF455, 0x10,
    0xF456, 0x06,
    0xF457, 0x80,
    0xF458, 0x10,
    0xF459, 0x06,
    0xF478, 0x20,
    0xF479, 0x80,
    0xF47A, 0x80,
    0xF47B, 0x20,
    0xF47C, 0x80,
    0xF47D, 0x80,
    0xF47E, 0x20,
    0xF47F, 0x80,
    0xF480, 0x80,
    0xF481, 0x20,
    0xF482, 0x60,
    0xF483, 0x80,
    0xF484, 0x20,
    0xF485, 0x60,
    0xF486, 0x80,

    0x9852, 0x00,
    0x9954, 0x0F,
    0xA7AD, 0x01,
    0xA7CB, 0x01,
    0xAE09, 0xFF,
    0xAE0A, 0xFF,
    0xAE12, 0x58,
    0xAE13, 0x58,
    0xAE15, 0x10,
    0xAE16, 0x10,
    0xAF05, 0x48,
    0xB07C, 0x02,

    0x0112, 0x0A,
    0x0113, 0x0A,
    0x0114, 0x03,
    0x0342, 0x23,  // 8976
    0x0343, 0x10,
    0x0340, 0x0B,  // 3064
    0x0341, 0xF8,

    0x0344, 0x00,
    0x0345, 0x00,
    0x0346, 0x00,
    0x0347, 0x00,
    0x0348, 0x1F,
    0x0349, 0x3F,
    0x034A, 0x17,
    0x034B, 0x6F,

    0x0220, 0x62,
    0x0222, 0x01,
    0x0900, 0x01,
    0x0901, 0x22,
    0x0902, 0x08,
    0x3140, 0x00,
    0x3246, 0x81,
    0x3247, 0x81,
    0x3F15, 0x00,
    0x0401, 0x00,
    0x0404, 0x00,
    0x0405, 0x10,
    0x0408, 0x00,	//0
    0x0409, 0x00,
    0x040A, 0x01,	//375
    0x040B, 0x77,
    0x040C, 0x0F,
    0x040D, 0xA0,
    0x040E, 0x08,
    0x040F, 0xCA,
    0x034C, 0x0F,	//4000
    0x034D, 0xA0,
    0x034E, 0x08,	//2250
    0x034F, 0xCA,
    0x0301, 0x05,
    0x0303, 0x04,
    0x0305, 0x04,
    0x0306, 0x01,
    0x0307, 0x58,
    0x030B, 0x02,
    0x030D, 0x03,
    0x030E, 0x01,
    0x030F, 0x1F,
    0x0310, 0x01,
    0x3620, 0x00,
    0x3621, 0x00,
    0x3C11, 0x04,
    0x3C12, 0x03,
    0x3C13, 0x2D,
    0x3F0C, 0x01,
    0x3F14, 0x00,
    0x3F80, 0x00,
    0x3F81, 0x14,
    0x3F8C, 0x00,
    0x3F8D, 0x14,
    0x3FF8, 0x00,
    0x3FF9, 0x3C,
    0x3FFE, 0x01,
    0x3FFF, 0x8C,
    0x0202, 0x0B,
    0x0203, 0xC8,
    0x0224, 0x01,
    0x0225, 0xF4,
    0x3FE0, 0x01,
    0x3FE1, 0xF4,
    0x0204, 0x00,
    0x0205, 0x70,
    0x0216, 0x00,
    0x0217, 0x70,
    0x0218, 0x01,
    0x0219, 0x00,
    0x020E, 0x01,
    0x020F, 0x00,
    0x0210, 0x01,
    0x0211, 0x00,
    0x0212, 0x01,
    0x0213, 0x00,
    0x0214, 0x01,
    0x0215, 0x00,
    0x3FE2, 0x00,
    0x3FE3, 0x70,
    0x3FE4, 0x01,
    0x3FE5, 0x00,
    0x323B, 0x00,
    0x323C, 0x00,
    0x3E20, 0x02,
    0x3E3B, 0x01,
    0x4434, 0x01,
    0x4435, 0xF0,
};

#if EN_EXP_HDR_30FPS
uint16_t imx586_init_default_hdr_setting[] = {
    0x0136, 0x18, //24MB
    0x0137, 0x00,
    0x3C7E, 0x0A,
    0x3C7F, 0x0A,
    0x0111, 0x02,
    0x0220, 0x63, //3-Exp-HDR @30fps
    0x0222, 0x01,
    0x3C05, 0x01,
    0x0900, 0x00,
    0x0901, 0x11,
    0x3140, 0x04,
    0x3C03, 0x10,
    0x3C04, 0x10,
    0x3C0F, 0x20,
    0x3F88, 0x00,
    0x3F8E, 0x00,
    0x5282, 0x01,
    0x9004, 0x14,
    0x9200, 0xF4,
    0x9201, 0xA7,
    0x9202, 0xF4,
    0x9203, 0xAA,
    0x9204, 0xF4,
    0x9205, 0xAD,
    0x9206, 0xF4,
    0x9207, 0xB0,
    0x9208, 0xF4,
    0x9209, 0xB3,
    0x920A, 0xB7,
    0x920B, 0x34,
    0x920C, 0xB7,
    0x920D, 0x36,
    0x920E, 0xB7,
    0x920F, 0x37,
    0x9210, 0xB7,
    0x9211, 0x38,
    0x9212, 0xB7,
    0x9213, 0x39,
    0x9214, 0xB7,
    0x9215, 0x3A,
    0x9216, 0xB7,
    0x9217, 0x3C,
    0x9218, 0xB7,
    0x9219, 0x3D,
    0x921A, 0xB7,
    0x921B, 0x3E,
    0x921C, 0xB7,
    0x921D, 0x3F,
    0x921E, 0x77,
    0x921F, 0x77,
    0x9222, 0xC4,
    0x9223, 0x4B,
    0x9224, 0xC4,
    0x9225, 0x4C,
    0x9226, 0xC4,
    0x9227, 0x4D,
    0x9810, 0x14,
    0x9814, 0x14,
    0x99B2, 0x20,
    0x99B3, 0x0F,
    0x99B4, 0x0F,
    0x99B5, 0x0F,
    0x99B6, 0x0F,
    0x99E4, 0x0F,
    0x99E5, 0x0F,
    0x99E6, 0x0F,
    0x99E7, 0x0F,
    0x99E8, 0x0F,
    0x99E9, 0x0F,
    0x99EA, 0x0F,
    0x99EB, 0x0F,
    0x99EC, 0x0F,
    0x99ED, 0x0F,
    0xA569, 0x06,
    0xA56A, 0x13,
    0xA56B, 0x13,
    0xA679, 0x20,
    0xA830, 0x68,
    0xA831, 0x56,
    0xA832, 0x2B,
    0xA833, 0x55,
    0xA834, 0x55,
    0xA835, 0x16,
    0xA837, 0x51,
    0xA838, 0x34,
    0xA854, 0x4F,
    0xA855, 0x48,
    0xA856, 0x45,
    0xA857, 0x02,
    0xA85A, 0x23,
    0xA85B, 0x16,
    0xA85C, 0x12,
    0xA85D, 0x02,
    0xAC72, 0x01,
    0xAC73, 0x26,
    0xAC74, 0x01,
    0xAC75, 0x26,
    0xAC76, 0x00,
    0xAC77, 0xC4,
    0xB051, 0x02,
    0xC020, 0x01,
    0xC61D, 0x00,
    0xC625, 0x00,
    0xC638, 0x03,
    0xC63B, 0x01,
    0xE286, 0x31,
    0xE2A6, 0x32,
    0xE2C6, 0x33,
    0xEA4B, 0x00,
    0xEA4C, 0x00,
    0xEA4D, 0x00,
    0xEA4E, 0x00,
    0xF000, 0x00,
    0xF001, 0x10,
    0xF00C, 0x00,
    0xF00D, 0x40,
    0xF030, 0x00,
    0xF031, 0x10,
    0xF03C, 0x00,
    0xF03D, 0x40,
    0xF44B, 0x80,
    0xF44C, 0x10,
    0xF44D, 0x06,
    0xF44E, 0x80,
    0xF44F, 0x10,
    0xF450, 0x06,
    0xF451, 0x80,
    0xF452, 0x10,
    0xF453, 0x06,
    0xF454, 0x80,
    0xF455, 0x10,
    0xF456, 0x06,
    0xF457, 0x80,
    0xF458, 0x10,
    0xF459, 0x06,
    0xF478, 0x20,
    0xF479, 0x80,
    0xF47A, 0x80,
    0xF47B, 0x20,
    0xF47C, 0x80,
    0xF47D, 0x80,
    0xF47E, 0x20,
    0xF47F, 0x80,
    0xF480, 0x80,
    0xF481, 0x20,
    0xF482, 0x60,
    0xF483, 0x80,
    0xF484, 0x20,
    0xF485, 0x60,
    0xF486, 0x80,

    //HDR config
    0x0112, 0x0A,
    0x0113, 0x0A,
    0x0114, 0x03,
    0x0342, 0x24, //9440
    0x0343, 0xE0,
    0x0340, 0x17, //6067
    0x0341, 0xB3,
    0x3C06, 0x00,
    0x0902, 0x0A,
    0x3C07, 0x00,
    0x3246, 0x01,
    0x3247, 0x01,
    0x3F15, 0x00,
    0x0301, 0x05,
    0x0303, 0x02,
    0x0305, 0x04, //1/4
    0x0306, 0x01, //358
    0x0307, 0x66,
    0x030B, 0x01,
    0x030D, 0x0C, //1/12
    0x030E, 0x04, //1042
    0x030F, 0x12,
    0x0310, 0x01,
    0x3620, 0x00,
    0x3621, 0x00,
    0x3C11, 0x08,
    0x3C12, 0x08,
    0x3C13, 0x2A,
    0x3F0C, 0x00,
    0x3F14, 0x01,
    0x3F80, 0x01,
    0x3F81, 0x7C,
    0x3F8C, 0x03,
    0x3F8D, 0x84,
    0x3FF8, 0x00,
    0x3FF9, 0x00,
    0x3FFE, 0x00,
    0x3FFF, 0xA2,
    0x0202, 0x17, //coarse time
    0x0203, 0x83,
    0x0224, 0x17, //coarse time
    0x0225, 0x83,
    0x3FE0, 0x17,
    0x3FE1, 0x83,
    0x0204, 0x00,
    0x0205, 0x70,
    0x0216, 0x00,
    0x0217, 0x70,
    0x0218, 0x01,
    0x0219, 0x00,
    0x020E, 0x01,
    0x020F, 0x00,
    0x0210, 0x01,
    0x0211, 0x00,
    0x0212, 0x01,
    0x0213, 0x00,
    0x0214, 0x01,
    0x0215, 0x00,
    0x3FE2, 0x00,
    0x3FE3, 0x70,
    0x3FE4, 0x01,
    0x3FE5, 0x00,
    0x323B, 0x01,
    0x323C, 0x01,
    0x3E20, 0x02,
    0x3E3B, 0x00,
    0x4434, 0x00,
    0x4435, 0xF8,
    0x3C08, 0x03,
    0x3620, 0x00,
    0x3C09, 0xFF,
    0x323A, 0x00,
    0x323C, 0x00,
    0x37E0, 0x00,
    0x37E1, 0x00,
    0x37E2, 0x00,
    0x37E3, 0x00,
    0x37E4, 0x0F,
    0x37E5, 0xA0,
    0x37E6, 0x0B,
    0x37E7, 0xB8,
    0x37F0, 0x00,
    0x37F1, 0x00,
    0x37F2, 0x00,
    0x37F3, 0x00,
    0x37F4, 0x0F,
    0x37F5, 0xA0,
    0x37F6, 0x0B,
    0x37F7, 0xB8,
    0x37F8, 0x03,
    0xAE27, 0x05,
    0xAE28, 0x05,
    0xAE29, 0x05,
    0x3C00, 0x10,
    0x3C01, 0x10,
    0x3C02, 0x10,
    0x3C0A, 0x01,
    0x8943, 0x00,
    0x3C05, 0x00,
    0x3C0B, 0x00,
    0x3C0C, 0x00,
    0x3C0D, 0x03,
    0x3C0E, 0xFF,
    0x0B00, 0x01,
    0x380C, 0x00,
    0x380D, 0x80,
    0xF501, 0x01,
    0xF503, 0x01,
    0xF505, 0x01,
    0xF507, 0x01,
    0xF509, 0x01,
    0xF50B, 0x01,
    0xF50D, 0x01,
    0xF50F, 0x01,
    0xF511, 0x01,
    0xF513, 0x01,
    0xF515, 0x01,
    0xF517, 0x01,
    0xF519, 0x01,
    0xF51B, 0x01,
    0xF51D, 0x01,
    0xF006, 0x00,
    0xF008, 0x00,
    0xF00A, 0x00,
    0xF012, 0x00,
    0xF014, 0x00,
    0xF016, 0x00,
    0xF007, 0x08,
    0xF009, 0x08,
    0xF00B, 0x08,
    0xF013, 0x10,
    0xF015, 0x10,
    0xF017, 0x10,
    0xF53C, 0x00,
    0xF53D, 0x20,
    0xF53E, 0x00,
    0xF53F, 0x20,
    0xF540, 0x00,
    0xF541, 0x20,
    0xF542, 0x00,
    0xF543, 0x20,
    0xF544, 0x00,
    0xF545, 0x20,
    0xF546, 0x00,
    0xF547, 0x20,
    0xF548, 0x00,
    0xF549, 0x20,
    0xF54A, 0x00,
    0xF54B, 0x20,
    0xF54C, 0x00,
    0xF54D, 0x20,
    0xF54E, 0x00,
    0xF54F, 0x20,
    0xF550, 0x00,
    0xF551, 0x20,
    0xF552, 0x00,
    0xF553, 0x20,
    0xF554, 0x00,
    0xF555, 0x20,
    0xF556, 0x00,
    0xF557, 0x20,
    0xF558, 0x00,
    0xF559, 0x20,
    0xBCB9, 0x01,
    //image quality
    0x9852, 0x00,
    0x9954, 0x0F,
    0xA7AD, 0x01,
    0xA7CB, 0x01,
    0xAE09, 0xFF,
    0xAE0A, 0xFF,
    0xAE12, 0x58,
    0xAE13, 0x58,
    0xAE15, 0x10,
    0xAE16, 0x10,
    0xAF05, 0x48,
    0xB07C, 0x02,
};
#elif EN_QHDR_30FPS_0
uint16_t imx586_init_default_hdr_setting[] = {
    0x0136, 0x18,
    0x0137, 0x00,
    0x3C7E, 0x02,
    0x3C7F, 0x0A,
    0x0111, 0x02,
    0x380C, 0x00,
    0x3C00, 0x10,
    0x3C01, 0x10,
    0x3C02, 0x10,
    0x3C03, 0x10,
    0x3C04, 0x10,
    0x3C05, 0x01,
    0x3C06, 0x00,
    0x3C07, 0x00,
    0x3C08, 0x03,
    0x3C09, 0xFF,
    0x3C0A, 0x01,
    0x3C0B, 0x00,
    0x3C0C, 0x00,
    0x3C0D, 0x03,
    0x3C0E, 0xFF,
    0x3C0F, 0x20,
    0x3F88, 0x00,
    0x3F8E, 0x00,
    0x5282, 0x01,
    0x9004, 0x14,
    0x9200, 0xF4,
    0x9201, 0xA7,
    0x9202, 0xF4,
    0x9203, 0xAA,
    0x9204, 0xF4,
    0x9205, 0xAD,
    0x9206, 0xF4,
    0x9207, 0xB0,
    0x9208, 0xF4,
    0x9209, 0xB3,
    0x920A, 0xB7,
    0x920B, 0x34,
    0x920C, 0xB7,
    0x920D, 0x36,
    0x920E, 0xB7,
    0x920F, 0x37,
    0x9210, 0xB7,
    0x9211, 0x38,
    0x9212, 0xB7,
    0x9213, 0x39,
    0x9214, 0xB7,
    0x9215, 0x3A,
    0x9216, 0xB7,
    0x9217, 0x3C,
    0x9218, 0xB7,
    0x9219, 0x3D,
    0x921A, 0xB7,
    0x921B, 0x3E,
    0x921C, 0xB7,
    0x921D, 0x3F,
    0x921E, 0x77,
    0x921F, 0x77,
    0x9222, 0xC4,
    0x9223, 0x4B,
    0x9224, 0xC4,
    0x9225, 0x4C,
    0x9226, 0xC4,
    0x9227, 0x4D,
    0x9810, 0x14,
    0x9814, 0x14,
    0x99B2, 0x20,
    0x99B3, 0x0F,
    0x99B4, 0x0F,
    0x99B5, 0x0F,
    0x99B6, 0x0F,
    0x99E4, 0x0F,
    0x99E5, 0x0F,
    0x99E6, 0x0F,
    0x99E7, 0x0F,
    0x99E8, 0x0F,
    0x99E9, 0x0F,
    0x99EA, 0x0F,
    0x99EB, 0x0F,
    0x99EC, 0x0F,
    0x99ED, 0x0F,
    0xA569, 0x06,
    0xA56A, 0x13,
    0xA56B, 0x13,
    0xA679, 0x20,
    0xA830, 0x68,
    0xA831, 0x56,
    0xA832, 0x2B,
    0xA833, 0x55,
    0xA834, 0x55,
    0xA835, 0x16,
    0xA837, 0x51,
    0xA838, 0x34,
    0xA854, 0x4F,
    0xA855, 0x48,
    0xA856, 0x45,
    0xA857, 0x02,
    0xA85A, 0x23,
    0xA85B, 0x16,
    0xA85C, 0x12,
    0xA85D, 0x02,
    0xAC72, 0x01,
    0xAC73, 0x26,
    0xAC74, 0x01,
    0xAC75, 0x26,
    0xAC76, 0x00,
    0xAC77, 0xC4,
    0xB051, 0x02,
    0xC020, 0x01,
    0xC61D, 0x00,
    0xC625, 0x00,
    0xC638, 0x03,
    0xC63B, 0x01,
    0xE286, 0x31,
    0xE2A6, 0x32,
    0xE2C6, 0x33,
    0xEA4B, 0x00,
    0xEA4C, 0x00,
    0xEA4D, 0x00,
    0xEA4E, 0x00,
    0xF000, 0x00,
    0xF001, 0x10,
    0xF00C, 0x00,
    0xF00D, 0x40,
    0xF030, 0x00,
    0xF031, 0x10,
    0xF03C, 0x00,
    0xF03D, 0x40,
    0xF44B, 0x80,
    0xF44C, 0x10,
    0xF44D, 0x06,
    0xF44E, 0x80,
    0xF44F, 0x10,
    0xF450, 0x06,
    0xF451, 0x80,
    0xF452, 0x10,
    0xF453, 0x06,
    0xF454, 0x80,
    0xF455, 0x10,
    0xF456, 0x06,
    0xF457, 0x80,
    0xF458, 0x10,
    0xF459, 0x06,
    0xF478, 0x20,
    0xF479, 0x80,
    0xF47A, 0x80,
    0xF47B, 0x20,
    0xF47C, 0x80,
    0xF47D, 0x80,
    0xF47E, 0x20,
    0xF47F, 0x80,
    0xF480, 0x80,
    0xF481, 0x20,
    0xF482, 0x60,
    0xF483, 0x80,
    0xF484, 0x20,
    0xF485, 0x60,
    0xF486, 0x80,
    //HDR mode
    0x0112, 0x0A,
    0x0113, 0x0A,
    0x0114, 0x03,
    0x0342, 0x24, //9440
    0x0343, 0xE0,
    0x0340, 0x17, //6101
    0x0341, 0xD5,
    0x0900, 0x00,
    0x0901, 0x11,
    0x0902, 0x0A,
    0x3140, 0x04,
    0x3246, 0x01,
    0x3247, 0x01,
    0x3F15, 0x00,
    0x0301, 0x05,
    0x0303, 0x02,
    0x0305, 0x04,
    0x0306, 0x01,
    0x0307, 0x68,
    0x030B, 0x01,
    0x030D, 0x04,
    0x030E, 0x01,
    0x030F, 0xA0,
    0x0310, 0x01,
    0x3620, 0x00,
    0x3621, 0x00,
    0x3C11, 0x08,
    0x3C12, 0x08,
    0x3C13, 0x2A,
    0x3F0C, 0x00,
    0x3F14, 0x01,
    0x3F80, 0x01,
    0x3F81, 0x8C,
    0x3F8C, 0x03,
    0x3F8D, 0x84,
    0x3FF8, 0x00,
    0x3FF9, 0x00,
    0x3FFE, 0x00,
    0x3FFF, 0x84,
    0x0202, 0x17,
    0x0203, 0xA5,
    0x0224, 0x17,
    0x0225, 0xA5,
    0x3FE0, 0x17,
    0x3FE1, 0xA5,
    0x0204, 0x00,
    0x0205, 0x70,
    0x0216, 0x00,
    0x0217, 0x70,
    0x0218, 0x01,
    0x0219, 0x00,
    0x020E, 0x01,
    0x020F, 0x00,
    0x0210, 0x01,
    0x0211, 0x00,
    0x0212, 0x01,
    0x0213, 0x00,
    0x0214, 0x01,
    0x0215, 0x00,
    0x3FE2, 0x00,
    0x3FE3, 0x70,
    0x3FE4, 0x01,
    0x3FE5, 0x00,
    0x323B, 0x00,
    0x323C, 0x00,
    0x3E20, 0x01,
    0x3E37, 0x00,
    //image quality
    0x9852, 0x00,
    0x9954, 0x0F,
    0xA7AD, 0x01,
    0xA7CB, 0x01,
    0xAE09, 0xFF,
    0xAE0A, 0xFF,
    0xAE12, 0x58,
    0xAE13, 0x58,
    0xAE15, 0x10,
    0xAE16, 0x10,
    0xAF05, 0x48,
    0xB07C, 0x02,
};
#elif EN_QHDR_30FPS_1
uint16_t imx586_init_default_hdr_setting[] = {
    0x0136, 0x18,
    0x0137, 0x00,
    0x3C7E, 0x02,
    0x3C7F, 0x0A,
    0x0111, 0x02,
    0x380C, 0x00,
    0x3C00, 0x10,
    0x3C01, 0x10,
    0x3C02, 0x10,
    0x3C03, 0x10,
    0x3C04, 0x10,
    0x3C05, 0x01,
    0x3C06, 0x00,
    0x3C07, 0x00,
    0x3C08, 0x03,
    0x3C09, 0xFF,
    0x3C0A, 0x01,
    0x3C0B, 0x00,
    0x3C0C, 0x00,
    0x3C0D, 0x03,
    0x3C0E, 0xFF,
    0x3C0F, 0x20,
    0x3F88, 0x00,
    0x3F8E, 0x00,
    0x5282, 0x01,
    0x9004, 0x14,
    0x9200, 0xF4,
    0x9201, 0xA7,
    0x9202, 0xF4,
    0x9203, 0xAA,
    0x9204, 0xF4,
    0x9205, 0xAD,
    0x9206, 0xF4,
    0x9207, 0xB0,
    0x9208, 0xF4,
    0x9209, 0xB3,
    0x920A, 0xB7,
    0x920B, 0x34,
    0x920C, 0xB7,
    0x920D, 0x36,
    0x920E, 0xB7,
    0x920F, 0x37,
    0x9210, 0xB7,
    0x9211, 0x38,
    0x9212, 0xB7,
    0x9213, 0x39,
    0x9214, 0xB7,
    0x9215, 0x3A,
    0x9216, 0xB7,
    0x9217, 0x3C,
    0x9218, 0xB7,
    0x9219, 0x3D,
    0x921A, 0xB7,
    0x921B, 0x3E,
    0x921C, 0xB7,
    0x921D, 0x3F,
    0x921E, 0x77,
    0x921F, 0x77,
    0x9222, 0xC4,
    0x9223, 0x4B,
    0x9224, 0xC4,
    0x9225, 0x4C,
    0x9226, 0xC4,
    0x9227, 0x4D,
    0x9810, 0x14,
    0x9814, 0x14,
    0x99B2, 0x20,
    0x99B3, 0x0F,
    0x99B4, 0x0F,
    0x99B5, 0x0F,
    0x99B6, 0x0F,
    0x99E4, 0x0F,
    0x99E5, 0x0F,
    0x99E6, 0x0F,
    0x99E7, 0x0F,
    0x99E8, 0x0F,
    0x99E9, 0x0F,
    0x99EA, 0x0F,
    0x99EB, 0x0F,
    0x99EC, 0x0F,
    0x99ED, 0x0F,
    0xA569, 0x06,
    0xA56A, 0x13,
    0xA56B, 0x13,
    0xA679, 0x20,
    0xA830, 0x68,
    0xA831, 0x56,
    0xA832, 0x2B,
    0xA833, 0x55,
    0xA834, 0x55,
    0xA835, 0x16,
    0xA837, 0x51,
    0xA838, 0x34,
    0xA854, 0x4F,
    0xA855, 0x48,
    0xA856, 0x45,
    0xA857, 0x02,
    0xA85A, 0x23,
    0xA85B, 0x16,
    0xA85C, 0x12,
    0xA85D, 0x02,
    0xAC72, 0x01,
    0xAC73, 0x26,
    0xAC74, 0x01,
    0xAC75, 0x26,
    0xAC76, 0x00,
    0xAC77, 0xC4,
    0xB051, 0x02,
    0xC020, 0x01,
    0xC61D, 0x00,
    0xC625, 0x00,
    0xC638, 0x03,
    0xC63B, 0x01,
    0xE286, 0x31,
    0xE2A6, 0x32,
    0xE2C6, 0x33,
    0xEA4B, 0x00,
    0xEA4C, 0x00,
    0xEA4D, 0x00,
    0xEA4E, 0x00,
    0xF000, 0x00,
    0xF001, 0x10,
    0xF00C, 0x00,
    0xF00D, 0x40,
    0xF030, 0x00,
    0xF031, 0x10,
    0xF03C, 0x00,
    0xF03D, 0x40,
    0xF44B, 0x80,
    0xF44C, 0x10,
    0xF44D, 0x06,
    0xF44E, 0x80,
    0xF44F, 0x10,
    0xF450, 0x06,
    0xF451, 0x80,
    0xF452, 0x10,
    0xF453, 0x06,
    0xF454, 0x80,
    0xF455, 0x10,
    0xF456, 0x06,
    0xF457, 0x80,
    0xF458, 0x10,
    0xF459, 0x06,
    0xF478, 0x20,
    0xF479, 0x80,
    0xF47A, 0x80,
    0xF47B, 0x20,
    0xF47C, 0x80,
    0xF47D, 0x80,
    0xF47E, 0x20,
    0xF47F, 0x80,
    0xF480, 0x80,
    0xF481, 0x20,
    0xF482, 0x60,
    0xF483, 0x80,
    0xF484, 0x20,
    0xF485, 0x60,
    0xF486, 0x80,
    //QHDR 4000x3000
    0x0112, 0x0A,
    0x0113, 0x0A,
    0x0114, 0x03,
    0x0342, 0x24,
    0x0343, 0xE0,
    0x0340, 0x17,
    0x0341, 0xD5,
    0x0900, 0x00,
    0x0901, 0x11,
    0x0902, 0x0A,
    0x3140, 0x04,
    0x3246, 0x01,
    0x3247, 0x01,
    0x3F15, 0x00,
    0x0301, 0x05,
    0x0303, 0x02,
    0x0305, 0x04,
    0x0306, 0x01,
    0x0307, 0x68,
    0x030B, 0x01,
    0x030D, 0x04,
    0x030E, 0x01,
    0x030F, 0x8C,
    0x0310, 0x01,
    0x3620, 0x00,
    0x3621, 0x00,
    0x3C11, 0x08,
    0x3C12, 0x08,
    0x3C13, 0x2A,
    0x3F0C, 0x00,
    0x3F14, 0x01,
    0x3F80, 0x01,
    0x3F81, 0x8C,
    0x3F8C, 0x03,
    0x3F8D, 0x84,
    0x3FF8, 0x00,
    0x3FF9, 0x00,
    0x3FFE, 0x00,
    0x3FFF, 0x84,
    0x0202, 0x17,
    0x0203, 0xA5,
    0x0224, 0x17,
    0x0225, 0xA5,
    0x3FE0, 0x17,
    0x3FE1, 0xA5,
    0x0204, 0x00,
    0x0205, 0x70,
    0x0216, 0x00,
    0x0217, 0x70,
    0x0218, 0x01,
    0x0219, 0x00,
    0x020E, 0x01,
    0x020F, 0x00,
    0x0210, 0x01,
    0x0211, 0x00,
    0x0212, 0x01,
    0x0213, 0x00,
    0x0214, 0x01,
    0x0215, 0x00,
    0x3FE2, 0x00,
    0x3FE3, 0x70,
    0x3FE4, 0x01,
    0x3FE5, 0x00,
    0x323B, 0x00,
    0x323C, 0x00,
    0x3E20, 0x01,
    0x3E37, 0x00,
    //image quality
    0x9852, 0x00,
    0x9954, 0x0F,
    0xA7AD, 0x01,
    0xA7CB, 0x01,
    0xAE09, 0xFF,
    0xAE0A, 0xFF,
    0xAE12, 0x58,
    0xAE13, 0x58,
    0xAE15, 0x10,
    0xAE16, 0x10,
    0xAF05, 0x48,
    0xB07C, 0x02,
};
#endif

uint16_t imx586_init_3840x2160_hdr_setting[] = {
    0x0220, 0x63, //3-Exp-HDR @30fps
    0x0222, 0x01,

    /* 8000x4512 16:9 */
    //x_add_sta
    0x0344, 0x00,
    0x0345, 0x00,
    //y_add_sta
    0x0346, 0x02,
    0x0347, 0xE8,
    //x_add_end
    0x0348, 0x1F,
    0x0349, 0x3F,
    //y_add_sta
    0x034A, 0x14,
    0x034B, 0x87,

    /* Auto crop to 4000x2256 */
    //x_digital_offset 0x50:80
    0x0408, 0x00,
    0x0409, 0x50,
    //y_digital_offset 0x30:48
    0x040A, 0x00,
    0x040B, 0x30,

    //digtial output size
    0x040C, 0x0F, // 3840
    0x040D, 0x00,
    0x040E, 0x08, // 2160
    0x040F, 0x70,

    //scale
    0x0401, 0x00, /* 0:0ff, 1:h, 2:h&v*/
    0x0404, 0x00,
    0x0405, 0x10,

    //x_out_size
    0x034C, 0x0F, // 3840
    0x034D, 0x00,
    //y_out_size
    0x034E, 0x08, // 2160
    0x034F, 0x70,
};

uint16_t imx586_init_4000x3000_hdr_setting[] = {
    0x0220, 0x63, //3-Exp-HDR @30fps
    0x0222, 0x01,

    /* 8000x6000 4:3 */
    //x_add_sta
    0x0344, 0x00,
    0x0345, 0x00,
    //y_add_sta
    0x0346, 0x00,
    0x0347, 0x00,
    //x_add_end
    0x0348, 0x1F,
    0x0349, 0x3F,
    //y_add_sta
    0x034A, 0x17,
    0x034B, 0x6F,

    /* Auto crop to 4000x3000 */
    //x_digital_offset
    0x0408, 0x00,
    0x0409, 0x00,
    //y_digital_offset
    0x040A, 0x00,
    0x040B, 0x00,

    //digtial output size
    0x040C, 0x0F, // 4000
    0x040D, 0xA0,
    0x040E, 0x0B, // 3000
    0x040F, 0xB8,

    //scale
    0x0401, 0x00, /* 0:0ff, 1:h, 2:h&v*/
    0x0404, 0x00,
    0x0405, 0x10,

    //x_out_size
    0x034C, 0x0F, // 4000
    0x034D, 0xA0,
    //y_out_size
    0x034E, 0x0B, // 3000
    0x034F, 0xB8,
};

uint16_t imx586_init_hdr_ratio_1_setting[] = {
    0x0220, 0x01,
    0x0222, 0x01,
};

uint16_t imx586_init_hdr_ratio_2_setting[] = {
    0x0220, 0x01,
    0x0222, 0x02,
};

uint16_t imx586_init_hdr_ratio_4_setting[] = {
    0x0220, 0x01,
    0x0222, 0x04,
};

uint16_t imx586_init_hdr_ratio_8_setting[] = {
    0x0220, 0x01,
    0x0222, 0x08,
};

uint16_t imx586_stream_on_setting[] = {
    0x0100, 0x01
};

uint16_t imx586_stream_off_setting[] = {
    0x0100,	0x00
};

#endif  // UTILITY_SENSOR_INC_IMX586_SETTING_H_
